package com.oocl.o2o.client.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;
/**
 * @author XIEMI2
 *
 */
@Entity
@GenericGenerator(name = "advertisement_id_generator", strategy = "uuid")
public class Advertisement {
	@Id
	@GeneratedValue(generator = "advertisement_id_generator")
	@Column(columnDefinition = "char(32)")
	private String id;
	

	@ManyToOne
	@JoinColumn(name = "merchant_id", columnDefinition = "char(32)")
	private Merchant merchant;
	

	@ManyToOne
	@JoinColumn(name = "food_id", columnDefinition = "char(32)")
	private Food food;

	@Column(name = "advertisement_status")
	@Enumerated(EnumType.STRING)
	private AdvertisementStatus advertisementStatus;

	public Advertisement() {
	}

	public Advertisement(Merchant merchant, Food food, AdvertisementStatus advertisementStatus) {
		this.merchant = merchant;
		this.food = food;
		this.advertisementStatus = advertisementStatus;
	}

	public String getId() {
		return id;
	}

	public Merchant getMerchant() {
		return merchant;
	}

	public void setMerchant(Merchant merchant) {
		this.merchant = merchant;
	}

	public Food getFood() {
		return food;
	}

	public void setFood(Food food) {
		this.food = food;
	}

	public AdvertisementStatus getAdvertisementStatus() {
		return advertisementStatus;
	}

	public void setAdvertisementStatus(AdvertisementStatus advertisementStatus) {
		this.advertisementStatus = advertisementStatus;
	}

}
